<?php

namespace App\Jobs;

use App\Jobs\Job;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class SendRetrievePasswordCodeMail extends Job implements ShouldQueue
{
    use InteractsWithQueue, SerializesModels;

    protected $code;
    protected $email;

    /**
     * Create a new job instance.
     *
     * @param string $code
     * @param string $email
     * @return void
     */
    public function __construct($code, $email)
    {
        $this->code = $code;
        $this->email = $email;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        app('Phphub\Handler\EmailHandler')->sendCodeMail($this->code, $this->email);
    }
}
